<?php
/**
* 地址
*/
class Region extends BZ_Controller
{
    
    public function _init()
    {
        $this->load->model('region_model', 'region');
    }

    /**
     * 选择下级区域
     */
    public function selectChildren()
    {
        $postData = $this->input->post();
        if ($postData['type'] == 1) {
            $region = $this->region->getChinaRegion(array('region_type' => 1));
        } else {
            $region = $this->region->findByType($postData['id'], $postData['type']);
        }
        
        echo json_encode(
            array(
                'status' => true,
                'result'=> $region->result(),
                'type' => $postData['type']
            )
        );exit;
    }

}